gdk/x11: Ignore regular crossing events while in implicit grabs
authorCarlos Garnacho <carlosg@gnome.org>
Thu, 9 Jul 2020 14:53:47 +0000 (16:53 +0200)
committerCarlos Garnacho <carlosg@gnome.org>
Thu, 9 Jul 2020 15:02:07 +0000 (17:02 +0200)
commitc0c5ce2f9b48fdba77db2d504ea53ab265167eb2
tree5e577cf2ed61fb78d83daa8a49c19fc37f648f52
parent896ebdc9d75507dfbd56089aea1d7c959a7f7d44
gdk/x11: Ignore regular crossing events while in implicit grabs

If we create an implicit grab on a surface, leave the surface, and
release the button, we would get 2 XI_Leave events, one with mode
XINotifyNormal when the pointer leaves the surface, and another with
mode XINotifyUngrab when the button is released.

Meanwhile, the upper layers rely on crossing events being paired,
and particularly in no crossing event being sent until the implicit
grab is dismissed (either by releasing it, or via more pervasive
grabs).

Ignoring the set of XINotifyNormal events while an implicit grab
is active adapts the X11 backend to this behavior. If the grab were
released or taken away by another grab, a crossing event with one
of the other XINotify*Grab/XINotify*Ungrab will be generated.

Fixes: https://gitlab.gnome.org/GNOME/gtk/-/issues/2879
gdk/x11/gdkdevicemanager-xi2.c